<template>
  <div id="financialDetail">
    <div class="homeTitle">理财产品交易申请</div>
    <div class="tableBox">
      <div class="table">
        <!-- -------------------------------------------------------- -->
        <div class="tableTitle">申请人信息</div>
        <table>
          <tr>
            <td>机构编号</td> <td>{{user.no}}</td>
            <td>机构名称</td> <td>{{user.bank}}</td>
          </tr>
          <tr>
            <td>操作员工号</td> <td>{{user.jobNum}}</td>
            <td>操作员姓名</td> <td>{{user.name}}</td>
          </tr>
        </table>
        <!-- ------------------------------------------------- -->
        <div class="tableTitle">理财产品信息：</div>
        <table>
          <tr>
            <td>产品代码</td> <td>{{financialProducts.code}}</td>
            <td>产品名称</td> <td>{{financialProducts.name}}</td>
          </tr>
          <tr>
            <td>产品类型</td> <td>{{financialProducts.type}}</td>
            <td>利率类型</td> <td>{{financialProducts.rateType}}</td>
          </tr>
          <tr>
            <td>发售方分类</td> <td>{{financialProducts.revenuePattern}}</td>
            <td>发售银行性质</td> <td>{{financialProducts.issuingBank}}</td>
          </tr>
          <tr>
            <td>期限结构</td> <td>{{financialProducts.termStructure}}</td>
            <td>产品期限</td> <td>{{financialProducts.term}}</td>
          </tr>
          <tr>
            <td>起息日</td> <td>{{financialProducts.interestDate | dateformat}}</td>
            <td>到期日</td> <td>{{financialProducts.dueDate | dateformat}}</td>
          </tr>
          <tr>
            <td>计息基础</td> <td>{{financialProducts.countBasis}}</td>
            <td>预期收益率(%）</td> <td>{{financialProducts.expectedReturnStart}}至{{financialProducts. expectedReturnEnd}}</td>
          </tr>
          <tr>
            <td>收益模式</td> <td>{{financialProducts.revenuePattern}}</td>
            <td></td> <td></td>
          </tr>
        </table>
        <!-- ----------------------------------------------- -->
        <div class="tableTitle">交易信息：</div>
        <table>
          <tr>
            <td>申请编号</td> <td>{{finHold.applyNum}}</td>
            <td>申请日期</td> <td>{{finHold.createTime | dateformat}}</td>
          </tr>
          <tr>
            <td>购买方式</td> <td>{{finHold.ways}}</td>
            <td>成交编号</td> <td>{{finHold.transactionNumber}}</td>
          </tr>
          <tr>
            <td>年化收益率（%）</td> <td>{{finHold.annualized}}</td>
            <td>金额（元）</td> <td>{{finHold.money}}</td>
          </tr>
          <tr>
            <td>机构标识</td> <td>{{finHold.identification}}</td>
            <td>机构类型</td> <td>{{finHold.organizationType}}</td>
          </tr>
          <tr>
            <td>机构名称</td> <td>{{finHold.organizationName}}</td>
            <td>机构销售点</td> <td>{{finHold.institutionalPoint}}</td>
          </tr>
        </table>
      </div>
      <div class="btn">
        <el-button type="primary" size="small" @click="close">关闭</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'financialDetail',
  data () {
    return {
      data: '',
      finHold: '',
      financialProducts: '',
      user: '',
    };
  },
  mounted () {
    this.getdata();
  },
  methods: {
    getdata() {
      this.axios.get('financialProductsHold/selectOne', {params: {id: this.$route.query.id}})
        .then(({data})=> {
          this.data = data.data;
          this.finHold = data.data.finHold;
          this.financialProducts = data.data.financialProducts;
          this.user = data.data.user;
        })
    },
    close () {
      this.$router.go(-1);
    }
  }
};
</script>

<style lang="scss">
  #financialDetail {
    .tableBox {
      padding-top: 10;
      color: white;
      .tableTitle {
        line-height: 36px;
        padding-left: 20px;
      }
      table {
        border: 1px solid white;
        width: 100%;
        text-align: center;
        border-collapse:collapse;
        margin-bottom: 20px;
        tr {
          td {
            padding: 5px 10px;
            border-right: 1px solid white;
            border-bottom: 1px solid white;
            &:nth-child(odd) {
              background:#2F3638;
            }
            &:nth-child(even) {
              background: #646E6E;
            }
          }
        }
      }
      .btn {
        text-align: center;
      }
    }
  }
</style>
